<template>
	<view >
<!-- 		<view class="list-cell bxpp u-border-bottom" @click="bxpp">
			不限车型
		</view> -->
			<view class="cartype" v-for="(item, index) in list" :key="index">
				<view class="" style="padding: 10rpx 24rpx;" @click="carType(item.cxing)">
					{{item.cxing}}
				</view>
			</view>
	</view>
</template>

<script>
import API from "@/api/selectCar.js"
import app from "../../App.vue"
	export default {
		name:'carType',
		onLoad(options){
			this.cx = options.cx;
			this.ppai = options.ppai;
		},
		onShow() {
			this.getCarModelList();
		},
		data() {
			return {
				seriesId:"",
				ppai:"",
				cx:"",
				scrollTop: 0,
				list: []
			}
		},
		methods:{
			getCarModelList(){
				let data = {
					cx:this.cx,
					ppai:this.ppai
				}
				API.getCarModelList1(data).then(res=>{
					console.log(res);
					this.list = res.data;
				})
			},
			
			carType(cxing){
				console.log(cxing);
				let obj = {
					cxing:cxing,
					cx:this.cx,
					ppai:this.ppai
				}
				app.globalData.carCondition=obj
				uni.navigateBack({
					delta: 3
				})
			}
		},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop;
		},
		bxpp(){
			let data = {
				cx:this.cx,
				ppai:this.ppai
			}
			app.globalData.carCondition = this.data
			uni.navigateBack({
				delta: 3
			})
		},
		
	}
</script>

<style lang="scss" scoped>
	.list-cell {
		box-sizing: border-box;
		width: 100%;
		padding: 10px 24rpx;
		overflow: hidden;
		color: $u-content-color;
		font-size: 14px;
		line-height: 24px;
		background-color: #fff;
	}
	.cartype{
		box-sizing: border-box;
		width: 100%;
		padding: 10px 24rpx;
		overflow: hidden;
		color: $u-content-color;
		font-size: 14px;
		line-height: 24px;
		background-color: #fff;
		border-bottom: 1px solid #eee;
	}
</style>
